package com.itheima;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication
@MapperScan("com.itheima.dao")
@EnableScheduling // 关键：添加此注解，定时任务才会生效
public class ShTransactionsApplication  extends SpringBootServletInitializer {
    public static void main(String[] args) {
        SpringApplication.run(ShTransactionsApplication.class, args);
    }

    // 让外部 Tomcat 能识别
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(ShTransactionsApplication.class);
    }
}
